<?php 
  /**
   * @author EVANDRO DE OLIVEIRA.
   * @category TEMPLATE
   * @package TEMPLATES/SCRIPTS.
   * @since 17/03/2012.
   * @last_update 24/03/2012.
   * @copyright 2012.
   * @version 1.0.
   *
   */
  $objAuthNamespace = new Zend_Session_Namespace('Zend_Auth');
  
  echo $this->doctype('XHTML1_TRANSITIONAL'); 
?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <title><?php echo Zend_Registry::getInstance()->config->system->restrict->access->title?></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link type="text/css" rel="stylesheet" href="<?php echo $this->css?>login/login.css">
  </head>
  <body>
    <table align="center" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td>
          <form action="login" method="POST">
            <div id="outer">
              <div style="width: 350px;">
                <table border="0" width="100%">
                  <tr>
                    <td id="messenger" colspan="2">
                      <?php echo $this->flashMessage();?>
                    </td>
                  </tr>
                </table>
              </div>
              <div id="logo">
                <img src="<?php echo $this->imagens?>/template/tit_sem.png"/>
              </div>
              <div>
	              <table id="inner" border="0" width="100%">
	                <tr>
	                  <td id="td_login"><bold>Usuário:</bold></td>
	                  <td><input type="text" name="ds_login" value=""></td>
	                </tr>
	                <tr>
	                  <td id="td_login"><bold>Senha:</bold></td>
	                  <td><input type="password" name="ds_password" value=""></td>
	                </tr>
	                
	                <?php 
	                  if($objAuthNamespace->tentativa >= 3){
	                    ?>
			                <tr>
			                  <td colspan="3">
			                    <div id="captcha">
			                      <img src="<?php echo $this->baseUrl?>/media/imagens/login/captcha/<?php echo $this->captcha?>.png" />
			                      <br />
			                      Digite as letras e números da imagem:
			                      <input size="6" maxlength="10" type="text" id="ds_captcha" name="ds_captcha" />
			                      <br />
			                      <input type="hidden" value="<?php echo $this->captcha?>" name="idCaptcha" />  
			                    </div>
			                  </td>
			                </tr> 
			                <?php 
	                  }
	                  elseif($objAuthNamespace->tentativa >= 1 && $objAuthNamespace->tentativa < 3){
	                  	$intTentativa = 3 - $objAuthNamespace->tentativa;
	                  	?>
	                  	<tr>
	                      <td class="verdana10CinzaEscuro td_28" colspan="2">
	                        Tentativas Restantes: <?php echo $intTentativa?> 
	                      </td>
	                    </tr>  
	                    <?php 
	                  }
	                ?>
	                
	                <tr>
	                  <td>&nbsp;</td>
	                  <td><input name="submit" type="submit" value="ENTRAR" id="boton"></td>
	                </tr>
	              </table>
              </div>
            </div>
          </form>
        </td>
      </tr>
    </table>
  </body>
</html>